<?php
/*
 * This template does not output anything but a specific partial output
 */

// this is the standard template data
$templateData = array(
    'title' => $this->title,
    'resourceUri' => $this->resourceUri,
    'description' => $this->description,
    'descriptionHelper' => $this->descriptionHelper,
    'options'           => $this->options
);

if ((isset($this->description['http://lod2.eu/schema/next'])) || (isset($this->description['http://lod2.eu/schema/previous']))) {
    echo $this->partial( 'lod2/micro-navigation.phtml', $templateData);
}

if (isset($this->description['http://www.w3.org/1999/02/22-rdf-syntax-ns#type'])) {
    $types = array();
    foreach ($this->description['http://www.w3.org/1999/02/22-rdf-syntax-ns#type'] as $property) {
        if ((isset($property['value'])) && (Erfurt_Uri::check($property['value']))) {
            $types[$property['value']] = true;
        }
    }

    switch (true) {
        case (isset($types['http://lod2.eu/schema/WorkPackage'])):
            echo $this->partial('lod2/types/workpackage.phtml', $templateData);
            break;
        case (isset($types['http://lod2.eu/schema/ActivityCluster'])):
            echo $this->partial('lod2/types/cluster.phtml', $templateData);
            break;
        case (isset($types['http://rdfs.org/sioc/types#WikiArticle'])):
        case (isset($types['http://rdfs.org/sioc/ns#Post'])):
            echo $this->partial('lod2/types/article.phtml', $templateData);
            break;
        case (isset($types['http://usefulinc.com/ns/doap#Project'])):
            echo $this->partial('lod2/types/project.phtml', $templateData);
            break;
        case (isset($types['http://lod2.eu/schema/Partner'])):
        case (isset($types['http://xmlns.com/foaf/0.1/Organization'])):
            echo $this->partial('lod2/types/partner.phtml', $templateData);
            break;
        case (isset($types['http://xmlns.com/foaf/0.1/Person'])):
            echo $this->partial('lod2/types/person.phtml', $templateData);
            break;
        case (isset($types['http://lod2.eu/schema/Milestone'])):
            echo $this->partial('lod2/types/milestone.phtml', $templateData);
            break;
        case (isset($types['http://lod2.eu/schema/Deliverable'])):
            echo $this->partial('lod2/types/deliverable.phtml', $templateData);
            break;
        case (isset($types['http://lod2.eu/schema/Testimonial'])):
            echo $this->partial('lod2/types/testimonial.phtml', $templateData);
            break;
        case (isset($types['http://lod2.eu/schema/PressClipping'])):
            echo $this->partial('lod2/types/press.phtml', $templateData);
            break;
        case (isset($types['http://lod2.eu/schema/Demo'])):
            echo $this->partial('lod2/types/demo.phtml', $templateData);
            break;
        default:
            // no specific template found
            echo $this->partial( 'lod2/default.phtml', $templateData);
            break;
    }
}
